package com.tengju.support.domain.model.rule;

import com.tengju.support.domain.model.star.StarIndicatorType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UpgradeIndexMetaInfo extends MetaInfo {

    Integer targetStarLevel;

    /**
     * 管理过的经销商人数
     */
    Double manageDealerNum;

    /**
     * 直属客户数(不含注册用户)
     */
    Double customerMembersNum;

    /**
     * 培养过的经销商人数
     */
    Double developDealerNum;

    /**
     * 培养过城市服务商人数
     */
    Double developCityServiceNum;

    /**
     * 培养过sec人数
     */
    Double developSecNum;

    /**
     * 最近两个月服务费的平均值(1号上月和上上月平均,2号本月与上月平均)
     */
    Double recentAvgProfit;

    /**
     * 最近2月销售额平均值(1号上月,2号及以后本月)
     */
    Double recentTwoMonthsAvgAchievement;


    public void filledByIndexType(StarIndicatorType starIndicatorType,Double index) {

        if (starIndicatorType == null) {
            return;
        }

        switch (starIndicatorType) {
            case DEVELOP_SEC_NUM:
                this.developSecNum = index;
            case MANAGE_DEALER_NUM:
                this.manageDealerNum = index;
            case DEVELOP_DEALER_NUM:
                this.developDealerNum = index;
            case DEVELOP_CITY_SERVICE_NUM:
                this.developCityServiceNum = index;
            case CUSTOMER_MEMBERS_NUM:
                this.customerMembersNum = index;
            case RECENT_AVG_PROFIT:
                this.recentAvgProfit = index;
            case RECENT_TWO_MONTHS_AVG_ACHIEVEMENT:
                this.recentTwoMonthsAvgAchievement = index;
            default:
                return;
        }

    }


}
